package com.doit.day01

class MyScalaIterable extends Iterable[ScalaHero]{
  override def iterator: Iterator[ScalaHero] = new MyScalaIterator
}

object ScalaTest1{
  def main(args: Array[String]): Unit = {
    val iterable: MyScalaIterable = new MyScalaIterable
    val iterator: Iterator[ScalaHero] = iterable.iterator
    while (iterator.hasNext){
      println(iterator.next())
    }
  }
}